<template>
  <div>
    <div class="article-container" >
      <div class="PostCard">
        <p class="articleTitle">{{ article.title }}</p>
<!--        <div class="context">{{ article.content.slice(0,100) }}</div>-->
        <div class="context">{{ article.introduce }}</div>
        <el-row class="last">
          <el-col :span="12">
            <el-row type="flex" justify="start" style="width: 400px">
              <div class="time">{{article.createTime}}</div>
            </el-row>
          </el-col>
          <el-col :span="12">
            <el-row type="flex" justify="end">
              <slot name="operation1"></slot>
              <slot name="operation2"></slot>
            </el-row>
          </el-col>
        </el-row>

      </div>
    </div>
<!--    <div class="article-container">-->
<!--      <div class="card">-->
<!--        <p class="title">{{ article.title }}</p>-->
<!--        <span class="context">{{ article.context.slice(0,100) }}</span>-->
<!--      </div>-->
<!--    </div>-->
<!--    <div class="article-container">-->
<!--      <div class="card">-->
<!--        <p class="title">{{ article.title }}</p>-->
<!--        <span class="context">{{ article.context.slice(0,100) }}</span>-->
<!--      </div>-->
<!--    </div>-->
  </div>


</template>
<script>
import {getArticle} from "@/api/article";
export default {
  name:"ArticleContainer",
  props: {
    article: {
      // required: true,
    },},
  data(){
    return{

    }
  },
  created() {
    // this.getArticle()
    // alert(JSON.stringify(this.article))
  },
  methods:{
    getArticle(){
      getArticle({id:1})
      .then((response) => {
        if (response.success) {
            this.article=response.data
        }
      }).catch((e) => {
        _this.$message.error(e, "出现未知错误");
      })
    }
  }
}
</script>
<style lang="scss">
.PostCard{
  //background-color: #0a76a4;
  width: 100%;
  height: 130px;
  //width: 900px;
  margin-right: 20px;
  margin-left: 20px;
  margin-bottom: 5px;
  padding-bottom: 0;
}
.article-container .PostCard{
  //border-radius: 20px 20px 20px 20px;
  position: relative;
  display: flex;
  //justify-content: center;
  //align-items: center;
  flex-direction: column;
  cursor: pointer;
  transition: 0.1s;
}
.article-container{
  width: 90%;
  //height: 200px;
  margin-top: 5px;
  margin-right: 5px;
  padding-top: 5px;
  //margin-left: 300px;
  position: relative;
  display: flex;
  //justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 60px;
  background: linear-gradient(135deg,rgb(57,167,176),rgb(56,183,145));
  border-radius: 20px 20px 20px 20px;
}
//.article-container .card:hover{
//  height: 205px;
//}
.article-container:hover{
  transform: scale(1.01);
}
body{
  width: 100%;
  align-items: center;
}
p{
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 1px;
}
.context{
  margin-top: 1px;
}
.time{
  //width: 200px ;
  margin-top: 20px;
  //margin-right: 930px;
  font-weight: 600;
  color: #2F4F2F;
}
.last{
  width: 100%;
  position: absolute;
  bottom: 0;
}
</style>
